import 'dart:ui';
import 'package:flutter/material.dart';
import 'colors.dart';

/// 应用文本样式系统
/// 从 Figma 设计稿中提取的文本样式（使用 PingFang SC 字体）
class AppTextStyles {
  AppTextStyles._(); // 防止实例化

  // 标题样式
  static const TextStyle heading1 = TextStyle(
    fontFamily: 'PingFang SC',
    fontSize: 28,
    fontWeight: FontWeight.w600,
    height: 1.2,
    color: AppColors.textPrimary,
  );

  static const TextStyle heading2 = TextStyle(
    fontFamily: 'PingFang SC',
    fontSize: 22,
    fontWeight: FontWeight.w600,
    height: 1.3,
    color: AppColors.textPrimary,
  );

  static const TextStyle heading3 = TextStyle(
    fontFamily: 'PingFang SC',
    fontSize: 17,
    fontWeight: FontWeight.w500,
    height: 1.235,
    color: AppColors.textPrimary,
  );

  // 正文样式
  static const TextStyle body1 = TextStyle(
    fontFamily: 'PingFang SC',
    fontSize: 17,
    fontWeight: FontWeight.normal,
    height: 1.5,
    color: AppColors.textPrimary,
  );

  static const TextStyle body2 = TextStyle(
    fontFamily: 'PingFang SC',
    fontSize: 15,
    fontWeight: FontWeight.normal,
    height: 1.4,
    color: AppColors.textPrimary,
  );

  // 辅助文本样式（说明描述）
  static const TextStyle caption = TextStyle(
    fontFamily: 'PingFang SC',
    fontSize: 12,
    fontWeight: FontWeight.normal,
    height: 1.333,
    color: AppColors.textSecondary,
  );

  static const TextStyle captionMedium = TextStyle(
    fontFamily: 'PingFang SC',
    fontSize: 12,
    fontWeight: FontWeight.w500,
    height: 1.333,
    color: AppColors.textPrimary,
  );

  static const TextStyle overline = TextStyle(
    fontFamily: 'PingFang SC',
    fontSize: 11,
    fontWeight: FontWeight.w500,
    height: 1.3,
    color: AppColors.textTertiary,
  );

  // 按钮文本样式
  static const TextStyle button = TextStyle(
    fontFamily: 'PingFang SC',
    fontSize: 17,
    fontWeight: FontWeight.w600,
    height: 1.3,
    color: AppColors.textPrimary,
  );

  static const TextStyle buttonSmall = TextStyle(
    fontFamily: 'PingFang SC',
    fontSize: 15,
    fontWeight: FontWeight.w600,
    height: 1.3,
    color: AppColors.textPrimary,
  );

  // 数字样式（用于统计数据）
  static const TextStyle numberLarge = TextStyle(
    fontFamily: 'PingFang SC',
    fontSize: 36,
    fontWeight: FontWeight.bold,
    height: 1.2,
    color: AppColors.textPrimary,
    fontFeatures: [FontFeature.tabularFigures()],
  );

  static const TextStyle numberMedium = TextStyle(
    fontFamily: 'PingFang SC',
    fontSize: 24,
    fontWeight: FontWeight.w600,
    height: 1.3,
    color: AppColors.textPrimary,
    fontFeatures: [FontFeature.tabularFigures()],
  );

  // 链接样式
  static const TextStyle link = TextStyle(
    fontFamily: 'PingFang SC',
    fontSize: 15,
    fontWeight: FontWeight.normal,
    height: 1.4,
    color: AppColors.primary,
    decoration: TextDecoration.none,
  );
}
